package top.jiangqiang.crawler.core.entities;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.dromara.hutool.core.xml.XmlUtil;

import java.nio.charset.Charset;
import java.util.Map;

@Getter
@Setter
@NoArgsConstructor
public class XmlCrawler extends TextCrawler {
    public Map<String, Object> xmlToMap() {
        return XmlUtil.xmlToMap(getContent());
    }

    public Map<String, Object> xmlToMap(Charset charset) {
        return XmlUtil.xmlToMap(getContent(charset));
    }
}
